package com.zhixiang.xaec.service.bpmndemo;

import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Comment;
import org.activiti.engine.task.Task;

import com.zhixiang.core.command.QueryFilter;

/**
 * @author gao
 * @since 2017年1月5日
 * 
 */
public interface WorkflowService 
{
    public void saveNewDeploye(File file, String filename);
    
    public List<ProcessDefinition> findProcessDefinitionList(QueryFilter localQueryFilter);

    public List<Deployment> findDeploymentList(QueryFilter localQueryFilter);

    public void deleteProcessDefinitionByDeploymentId(String deploymentId);

    public InputStream findImageInputStream(String deploymentId, String imageName);

    public List<ProcessDefinition> findProcessDefinitionDistinctByCmpId(String companyId);

    public ProcessDefinition findProcessDefinitionByKey(String processKey);

    public InputStream findXMLInputStream(String deploymentId, String resourceName);

    public void saveStartProcess(String businessId, Class<?> businessType, Map<String, Object> variables);

    public List<Task> findUnfinishedTasksByUserId(String userId, QueryFilter localQueryFilter);
    
    public ProcessInstance getProcessInstanceById (String instanceId);
    
    public Integer processForward(String instanceId, String taskId, String message,
                                  String comment, Class<?> businessType,Map<String, Object> variables);
    public List<Comment> findComentsByInstanceId(String processInstanceId);

    public Map<String, Object> findCoordingByTask(String taskId);

    public ProcessDefinition findProcessDefinitionByTaskId(String taskId);

    public String findInstanceIdByBusinessId(String businessId,String className);
    
    public List<Task> findUnfinishedTasksByCandidateUser(String userId, QueryFilter localQueryFilter);
    
    
}
